<%--
  Created by IntelliJ IDEA.
  User: 86153
  Date: 2023/3/21
  Time: 10:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>


<html>
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link rel="stylesheet" type="text/css" href="css/css.css"/>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script src="js/jquery-3.6.0.js"></script>
	<script>
        function insert_Soldier(e) {
            var formObject = {};
            var formArray = $("#form1").serializeArray();
            $.each(formArray, function (i, item) {
                formObject[item.name] = item.value;
            });
            $.ajax({
                url: 'admin_info/insert_Soldier',
                headers: {
                    'Content-Type': 'application/json;charset=utf-8',
                },
                type: 'POST',
                data: JSON.stringify(formObject),
                dataType: "json",
                success: function (data) {
                    if(data.code=='0000'){
                        alert("添加失败，请重试");
	                    window.location.reload();
                    }else if(data.code=='0001'){
                        alert("添加成功");
	                    window.location.href='jsp/admin_view.jsp';
                    }else if(data.code=='0002'){
                        alert("请输入信息");
                        window.location.reload();
                    }else if(data.code=='0003'){
                        alert("账号已存在，请重新输入！");
                        window.location.reload();
                    }
                }
            })
        }
	</script>
	<style>
        .baBody1 {
            margin-top: 20px;
            margin-left: 35%;
        }

	</style>
</head>
<body>
<div id="pageAll">

	<div class="page ">
		<!-- 会员注册页面样式 -->
		<div class="banneradd bor">
			<div class="baTopNo">
				<span>添加退役军人信息</span>
			</div>
			<form id="form1">
				<div class="baBody1">
					<div class="bbD">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;姓名：<input type="text" class="input3" name="soldierName" placeholder="输入姓名"/>
					</div>
					<div class="bbD">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年龄：<input type="text" class="input3" name="soldierAge" placeholder="输入年龄"/>
					</div>
					<div class="bbD">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手机号：<input type="text" class="input3" name="mobile" placeholder="输入手机号"/>
					</div>
					<div class="bbD">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;家庭住址：<input type="text" class="input3" name="homeLocal" placeholder="输入家庭住址"/>
					</div>
					<div class="bbD">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;籍贯：<input type="text" class="input3" name="soldierOrigin" placeholder="输入籍贯"/>
					</div>
					<div class="bbD">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;工作状态：<select name="psStatus">
						                      <option>--请选择--</option>
						                      <option value="已就业">已就业</option>
						                      <option value="未就业">未就业</option>
					                          </select>
					</div>
					<div class="bbD">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;服役时间：<input type="date" class="input3" name="serviceTime"/>
					</div>
					<div class="bbD">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;退役时间：<input type="date" class="input3" name="decommissioningTime"/>
					</div>
					<div class="bbD">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;账号密码：<input type="text" class="input3" name="password" placeholder="输入账号密码"/>
					</div>

					<div class="bbD">
						<p class="bbDP">
							<span class="btn_ok btn_yes" onclick="insert_Soldier()"><input type="hidden"/>提交</span>
							<a class="btn_ok btn_no" href="jsp/admin_view.jsp">取消</a>
						</p>
					</div>
				</div>
			</form>
		</div>
	</div>


</div>


</body>
</html>
